Skip to content

Allow passing selected model to Configuration.check_consistent#45

Merged
LourensVeen merged 1 commit into
developfrom
issue_41_check_resources_selected_model_only
May 13, 2026
Merged

Allow passing selected model to Configuration.check_consistent#45
LourensVeen merged 1 commit into
developfrom
issue_41_check_resources_selected_model_only

Conversation

@LourensVeen
Copy link
Copy Markdown
Contributor

@LourensVeen LourensVeen commented May 8, 2026

This adds a parameter to Configuration.check_consistent with which the selected model can be passed. When checking whether the configuration is runnable, this will then only check whether that model has resources, and ignore missing resources for any other root models defined.

Addresses #41.

Copy link
Copy Markdown
Collaborator

@maarten-ic maarten-ic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! One small note, and be aware that this PR will conflict with #40 (but should be easy to resolve once one is merged)



@pytest.fixture
def config_consistent_partial_resources() -> Configuration:
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I usually prefer to keep test data close to the tests where they're used (i.e. define this fixture in test_configuration.py), and only move it to a shared conftest when it's used in multiple test files.

I'm also fine to keep it like this though!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that's a good point. The whole test_configuration.py is set up like this though, so maybe better to make a separate PR for that, where we change everything in one go?

@LourensVeen LourensVeen force-pushed the issue_41_check_resources_selected_model_only branch from f0402e3 to 4e7dde8 Compare May 11, 2026 20:28
@LourensVeen
Copy link
Copy Markdown
Contributor Author

Okay, rebased to fix conflict with #40, but I still need to check if this will interact with #44 and decide in which order to merge them.

@LourensVeen LourensVeen force-pushed the issue_41_check_resources_selected_model_only branch from 4e7dde8 to 5c4ab56 Compare May 13, 2026 17:12
@LourensVeen
Copy link
Copy Markdown
Contributor Author

Another rebase to cover the merger of #44, and I'm going to merge this. I'll make a separate PR for the conftest refactor (and maybe just move the consistency checks into a separate file...)

@LourensVeen LourensVeen merged commit 8c82060 into develop May 13, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants